import {request} from './request.js'

//登录·
export function loginApi(userLoginRequest){ 
	return request({
		url:'/api/user/login',
		method: 'post',
		data: userLoginRequest,
		sslVerify: false,
	})
}

//获取图片验证码
export function codeApi(phone){
	return request({
		url: `/api/user/code?phone=${phone}`,
		method: 'get',
	})
}

//获取验证码
export function phoneLoginApi(phone){
	return request({
		url: `/api/user/message?phone=${phone}`,
		method: 'get'
	})
}

//验证码登录
export function phoneLogin(phone,code){
	return request({
		url: `/api/user/phoneLogin?phone=${phone}&code=${code}`,
		method: 'get'
	})
}

//注册
export function logonApi(userRegisterRequest){
	return request({
		url: '/api/user/register',
		method: 'post',
		data: userRegisterRequest
	})
}

//根据id查询用户
export function getUserByIdApi(id){
	return request({
		url: `/api/user/getVolunteerInfo?userId=${id}`,
		method: 'get'
	})
}

//更新用户
export function updateUser(userUpdateRequest){
	return request({
		url: '/api/user/update',
		method: 'post',
		data: userUpdateRequest
	})
}